package com.ericsson.enap.modules.backup.job;

import com.ericsson.common.quartz.job.MainJob;
import com.ericsson.common.quartz.job.ManualQuartzJob;
import com.ericsson.common.quartz.service.QuartzTableManager;
import com.ericsson.common.util.LogFileName;
import com.ericsson.common.util.LoggerUtils;
import com.ericsson.enap.modules.backup.task.VgcDataBackupTask;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @description: 5GC网元备份功能主方法入口
 * @author: wangjingshi
 * @create: 2021-05-31 16:16
 */

@Component
public class VgcDataBackupJob implements MainJob {

    private Logger log = LoggerUtils.Logger(LogFileName.VgcDataBackupJob);

    @Autowired
    private QuartzTableManager quartzTableManager;
    @Autowired
    private VgcDataBackupTask vgcDataBackupTask;

    @Override
    public void doTask() {
        //vgcDataBackupTask.execute();
        log.info(" ==== cron : 0 30 5 * * ? ====" );
        quartzTableManager.addManualTaskJob("epcDataBackupJob","epcDataBackupJob",
                "epcDataBackupJob","epcDataBackupJob",
                ManualQuartzJob.class,"0 30 5 * * ?",vgcDataBackupTask);
    }

}
